import React, { Component } from 'react'
import "swiper/dist/css/swiper.css"
import Swiper from 'swiper'
export default class Home extends Component {
    render() {
        let { BannerList } = this.props;
        return (
            <div className="swiper-container banner">
                <div className="swiper-wrapper">
                    {
                        BannerList.map((item, index) => {
                            return (
                                <div className="swiper-slide" key={index}>
                                    <img style={{width:"100%",height:"200px"}} src={item} alt="" />
                                </div>
                            )
                        })
                    }
                </div>
                <div className="swiper-pagination"></div>
            </div>
        )
    }
    componentDidMount() {
        new Swiper('.swiper-container', {
            autoplay: {
                delay:2000,
                stopOnLastSlide: false,
                disableOnInteraction: false,
            },//可选选项，自动滑动
            loop: true,
            pagination: {
                el: '.swiper-pagination',
            },
            autoplay: {
                delay: 3000,
                stopOnLastSlide: false,
                disableOnInteraction: false,
            },
        })
    }
}